
*Bussmann, Margit; Banka, Andris; Stremming, Christina, 2025, "Replication Data for "How small-state allies perceive Germany: Assessing public-elite differences in Latvia"", https://doi.org/10.7910/DVN/QQCVHP, Harvard Dataverse, DRAFT VERSION 

version 18
 
use PVS_surveyLatvia2022, replace
svyset [pweight=weight], strata(region2)

*dummies for ethnicity, other as reference category
gen ethnicity_Latvian=1 if ethnicity==1
replace ethnicity_Latvian=0 if ethnicity_Latvian==.
gen ethnicity_Russian=1 if ethnicity==2
replace ethnicity_Russian=0 if ethnicity_Russian==.
gen ethnicity_other=1 if ethnicity==3
replace ethnicity_other=0 if ethnicity_other==.

gen citizenship_Latvian=1 if citizenship==1
replace citizenship_Latvian=0 if citizenship_Latvian==.
drop citizenship

replace gender=0 if gender==2
label var gender "1=male, 0=female" 


*rich if among 10% richest people
sum education householdincome, detail
gen rich=1 if householdincome>850 & householdincome~=.
replace rich=0 if rich==. & householdincome~=.

gen university=1 if education==5 /*higher education*/
replace university=0 if university==.


/*take hard to tell out, so that can use 5 Likert*/
replace leadership_Germany=. if leadership_Germany==8 
replace Germanmilitaryassistance=. if Germanmilitaryassistance==8
replace dialoguewithRussia=. if dialoguewithRussia==8
replace powerfulIOs=. if powerfulIOs==8

*make dummy for agree & strongly agree
gen agree_leadership=1 if leadership_Germany==1 | leadership_Germany==2
replace agree_leadership=0 if agree_leadership==. | leadership_Germany==.

gen agree_Germanmilitaryassistance=1 if Germanmilitaryassistance==1 | Germanmilitaryassistance==2
replace agree_Germanmilitaryassistance=0 if agree_Germanmilitaryassistance==. | Germanmilitaryassistance==.

gen agree_dialogRussia=1 if dialoguewithRussia==1 | dialoguewithRussia==2
replace agree_dialogRussia=0 if agree_dialogRussia==. | dialoguewithRussia==.

*Figure 1
histogram leadership_Germany, percent
histogram Germanmilitaryassistance, percent


*for Figure 2 
*name 3 most important allies
gen Canada=1 if NATOallies1==7 | NATOallies2==7 | NATOallies3==7
replace Canada=0 if Canada==.

gen Germany=1 if NATOallies1==2 | NATOallies2==2 | NATOallies3==2
replace Germany=0 if Germany==.

gen US=1 if NATOallies1==1 | NATOallies2==1 | NATOallies3==1
replace US=0 if US==.

gen UK=1 if NATOallies1==3 | NATOallies2==3 | NATOallies3==3
replace UK=0 if UK==.

gen France=1 if NATOallies1==4 | NATOallies2==4 | NATOallies3==4
replace France=0 if France==.

gen Estonia=1 if NATOallies1==5 | NATOallies2==5 | NATOallies3==5
replace Estonia=0 if Estonia==.

gen Lithuania=1 if NATOallies1==6 | NATOallies2==6 | NATOallies3==6
replace Lithuania=0 if Lithuania==.

gen Poland=1 if NATOallies1== 8| NATOallies2==8 | NATOallies3==8
replace Poland=0 if Poland==.

gen Denmark=1 if NATOallies1==9 | NATOallies2==9 | NATOallies3==9
replace Denmark=0 if Denmark==.

drop NATOallies*

*Figure 2
graph bar (sum) US Canada Germany UK France Poland Estonia Lithuania Denmark


*Table 1, elite in population
svy: logit agree_leadership yearsage gender  ethnicity_Latvian education 
svy: logit agree_leadership yearsage gender  ethnicity_Latvian university 
svy: logit agree_leadership yearsage gender  ethnicity_Latvian householdincome 
svy: logit agree_leadership yearsage gender  ethnicity_Latvian rich 


* Table A2, online appendix, robustness with ordered logit, from agree to disagree 
svy: ologit leadership_Germany yearsage gender  ethnicity_Latvian education 
svy: ologit leadership_Germany yearsage gender  ethnicity_Latvian householdincome 
svy: ologit leadership_Germany yearsage gender  ethnicity_Latvian rich 
svy: ologit leadership_Germany yearsage gender  ethnicity_Latvian university 

* Table A3, online appendix
sum relation_economic relation_political relation_security relation_cultural relation_education relation_neither relation_hardtotell

*Table 2, type of relationship, multiple answers possible
svy: logit relation_security yearsage ethnicity_Latvian gender education rich
svy: logit relation_political yearsage ethnicity_Latvian gender education rich
svy: logit relation_economic yearsage ethnicity_Latvian gender education rich
svy: logit relation_cultural yearsage ethnicity_Latvian gender education rich
svy: logit relation_education yearsage ethnicity_Latvian gender education rich

* Figure 3 & Table A4 (online appendix) on German leadership
svy: logit agree_leadership yearsage gender ethnicity_Latvian relation_security relation_political relation_economic relation_cultural relation_education

estimates store leadership

coefplot (leadership, mcolor(blue)  ciopts(lcolor(blue))), drop (_cons yearsage gender education ethnicity_Latvian) xline(0, lcolor(black) lwidth(thin) lpattern(dash)) coeflabels(relation_economic="economic relationship" relation_security="security relationship" relation_political="political relationship" relation_cultural="cultural relationship"  relation_education="education relationship")

* Figure 4 & Table A5 (online appendix) on dialog with Russia
histogram dialoguewithRussia, percent
svy: logit agree_dialogRussia yearsage gender ethnicity_Latvian householdincome education
estimates store dialogue

coefplot (dialogue, mcolor(blue)  ciopts(lcolor(blue))), drop (_cons ) xline(0, lcolor(black) lwidth(thin) lpattern(dash)) coeflabels(yearsage="age" gender="gender" ethnicity_Latvian="Latvian speaker" householdincome="household income"  education="education")









